﻿using Grow.ObjectMapper.CreateObjectMapper;
using Mapster;

namespace Grow.ObjectMapper.Mapster.CreateObjectMapper
{
    public class ObjectMapperBuilder : IObjectMapperBuilder
    {
        private readonly TypeAdapterConfig _typeAdapterConfig;

        public ObjectMapperBuilder(TypeAdapterConfig typeAdapterConfig)
        {
            _typeAdapterConfig = typeAdapterConfig;
        }

        public IMapperBuilder<TSource, TResult> Config<TSource, TResult>()
        {
            return new MapperBuilder<TSource, TResult>(_typeAdapterConfig.ForType<TSource, TResult>());
        }
    }
}
